home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q37337 < prev    next >
Text File  |  1988-11-19  |  1KB  |  38 lines

  1. Q37337 Floating-Point Error: infinity/infinity Hangs on 8087
  2. C Compiler
  3. 5.00 5.10
  4. MS-DOS
  5.  
  6. Summary:
  7.  
  8. The program below demonstrates a problem with the Microsoft
  9. floating-point error handling routines when run on an 8086- (or 8088-)
  10. based machine with an 8087 coprocessor.
  11.  
  12. Microsoft has confirmed this to be a problem in Version 5.10. We are
  13. researching this problem and will post new information as it becomes
  14. available.
  15.  
  16. More Information:
  17.  
  18. The program below should generate the following error:
  19.  
  20.    run-time error M6101: MATH
  21.    - floating-point error: invalid.
  22.  
  23. The program is as follows:
  24.  
  25.  main()
  26.  {
  27.     double x,y;
  28.     y = *(double *) "\0\0\0\0\0\0\xf0\x7f";   /* y = infinity */
  29.     x = y/y;     /* floating point exception infinity/infinity */
  30.  }
  31.  
  32. The program executes as expected on machines with a 80287 or 80387
  33. math coprocessor, or with machines without a coprocessor. On machines
  34. with a 8087 math coprocessor, the program hangs the machine.
  35.  
  36. Keywords:  buglist5.10
  37. Updated  88/11/19 08:01
  38.